package company.C58_AC;

public class C3 {

    public static void main(String[] args) {
        C3 c3 = new C3();
        System.out.println(c3.translateNum(12158));
    }

    int count = 0;

    public int translateNum(int num) {
        // write code here
        String str = String.valueOf(num);
        helper(str, 0, str.length());
        return count;
    }

    private void helper(String str, int index, int length) {
        if (length == index)
            count++;
        else {
            helper(str, index + 1, length);
            if (str.charAt(index) != '0' && length - index >= 2 && Integer.parseInt(str.substring(index, index + 2)) <= 25)
                helper(str, index + 2, length);;
        }
    }
}
